use "bam_ches_merged.dta"


//Figure 5
graph dot (mean) eu_rank_diff, over(family, sort(eu_rank_diff)) marker(1, mcolor(black)) ytitle(Absolute value of change in EU rank ordering:  CHES to BAM) legend(title(test)) graphregion(fcolor(white))
graph export "Change in EU rank order by family.pdf" 



//Figure 6--top panel
twoway (line eu_position_sd eu_position_sd_ranks,sort(eu_position_sd_ranks) ytitle("Standard Deviation")lcolor(black)) (line eu_bam_range eu_position_sd_ranks,sort(eu_position_sd_ranks) lcolor(blue)) (line eu_rank_diff eu_position_sd_ranks,sort(eu_position_sd_ranks) yaxis(2) ytitle("Change in rank orders", axis(2)) lcolor(red)), xtitle(Parties ordered by CHES uncertainty) legend(label(1 "CHES std dev") label(2 "BAM range") label(3 "Change in rank order")) graphregion(fcolor(white)) ylabel(, angle(horizontal) format(%4.2f)) ylabel(, angle(horizontal) axis(2))
graph export "EU uncertainty and rank order changes.pdf"

//Figure 6--bottom panel
twoway (lowess eu_position_sd eu_position_sd_ranks,sort(eu_position_sd_ranks) ytitle("Standard Deviation")lcolor(black)) (lowess eu_bam_range eu_position_sd_ranks,sort(eu_position_sd_ranks) lcolor(blue)) (lowess eu_rank_diff eu_position_sd_ranks,sort(eu_position_sd_ranks) yaxis(2) ytitle("Change in rank orders", axis(2)) lcolor(red)),  xtitle(Parties ordered by CHES uncertainty) legend(label(1 "CHES std dev") label(2 "BAM range") label(3 "Change in rank order")) graphregion(fcolor(white)) ylabel(, angle(horizontal) format(%4.2f)) ylabel(, angle(horizontal) axis(2))
graph export "EU uncertainty and rank order changes.pdf"



//Figure 7
twoway (lowess expert galtan_rank_diff , lcolor(green) lpattern(solid) sort(galtan_rank_diff))(lowess expert eu_rank_diff , lcolor(blue) lpattern(dash) sort(eu_rank_diff))(lowess expert lrecon_rank_diff , lcolor(red) lpattern(longdash_dot_dot) sort(lrecon_rank_diff)), xtitle(Changes in Rank Orders) ytitle(Number of experts) legend(label(1 "gal-tan rank changes") label(2 "EU rank changes") label(3 "L/R econ rank changes")) graphregion(fcolor(white)) ylabel(, angle(horizontal) format(%4.0f))

graph export "Number of experts and rank order changes.pdf"




